<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>我的人际关系 - 社交圈</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #2563eb;
            --primary-light: #60a5fa;
            --primary-dark: #1d4ed8;
            --secondary: #f97316;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --light-bg: #f8fafc;
            --card-bg: #ffffff;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --border-color: #e2e8f0;
            --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            --transition: all 0.25s ease;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--light-bg);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 65px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--card-bg);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            border-bottom: 1px solid var(--border-color);
            z-index: 1000;
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .nav-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        
        .nav-btn:hover {
            background-color: var(--light-bg);
            color: var(--primary);
        }
        
        /* 搜索和筛选区 */
        .search-bar {
            padding: 12px 16px;
            background-color: var(--card-bg);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 56px;
            z-index: 900;
        }
        
        .search-input-group {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            background-color: var(--light-bg);
            font-size: 0.9rem;
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
        }
        
        /* 关系类型筛选 */
        .relation-filters {
            display: flex;
            overflow-x: auto;
            padding: 10px 16px;
            background-color: var(--card-bg);
            border-bottom: 1px solid var(--border-color);
            gap: 8px;
        }
        
        .filter-chip {
            white-space: nowrap;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.85rem;
            background-color: var(--light-bg);
            color: var(--text-secondary);
            border: 1px solid var(--border-color);
            transition: var(--transition);
            flex-shrink: 0;
        }
        
        .filter-chip.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 视图切换 */
        .view-controls {
            padding: 10px 16px;
            background-color: var(--card-bg);
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-color);
        }
        
        .view-label {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }
        
        .view-options {
            display: flex;
            gap: 8px;
        }
        
        .view-btn {
            width: 34px;
            height: 34px;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            background-color: var(--light-bg);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        
        .view-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 关系列表容器 */
        .relations-list {
            padding: 12px;
        }
        
        /* 联系人卡片样式 */
        .relation-card {
            background-color: var(--card-bg);
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 12px;
            box-shadow: var(--shadow);
            transition: var(--transition);
        }
        
        .relation-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }
        
        /* 无图联系人样式 */
        .no-media .media-section {
            height: 160px;
            background-color: var(--light-bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
        }
        
        .no-media-icon {
            font-size: 3rem;
            margin-bottom: 8px;
        }
        
        /* 单图联系人样式 */
        .single-media .media-section {
            height: 160px;
            position: relative;
        }
        
        .single-media .media-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 多图联系人样式 */
        .multi-media .media-section {
            height: 160px;
        }
        
        .media-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(2, 1fr);
            height: 100%;
            gap: 2px;
        }
        
        .media-item {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 联系人信息区域 */
        .info-section {
            padding: 14px;
        }
        
        .relation-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 8px;
        }
        
        .person-main {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .person-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .person-details {
            min-width: 0;
        }
        
        .person-name {
            font-weight: 600;
            font-size: 1.05rem;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .relation-type {
            font-size: 0.75rem;
            padding: 2px 8px;
            border-radius: 10px;
            background-color: rgba(37, 99, 235, 0.1);
            color: var(--primary);
        }
        
        .relation-meta {
            font-size: 0.8rem;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .action-btn {
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 500;
            background-color: var(--primary);
            color: white;
            border: none;
            transition: var(--transition);
        }
        
        .action-btn.secondary {
            background-color: var(--light-bg);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
        }
        
        .relation-body {
            margin-bottom: 12px;
        }
        
        .relation-note {
            font-size: 0.9rem;
            color: var(--text-primary);
            line-height: 1.4;
            margin-bottom: 8px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .shared-interests {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        
        .interest-tag {
            padding: 3px 10px;
            background-color: rgba(37, 99, 235, 0.1);
            color: var(--primary);
            border-radius: 12px;
            font-size: 0.75rem;
        }
        
        .relation-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        
        .last-interaction {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        /* 列表视图样式 */
        .list-view .relations-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .list-view .relation-card {
            display: flex;
            height: 100px;
            padding: 10px;
        }
        
        .list-view .media-section {
            width: 80px;
            height: 80px;
            flex-shrink: 0;
        }
        
        .list-view .single-media .media-section,
        .list-view .multi-media .media-section,
        .list-view .no-media .media-section {
            height: 80px;
        }
        
        .list-view .info-section {
            flex: 1;
            padding: 0 10px;
            display: flex;
            flex-direction: column;
        }
        
        .list-view .relation-note,
        .list-view .shared-interests,
        .list-view .relation-footer {
            display: none;
        }
        
        .list-view .action-btn {
            margin-top: auto;
            align-self: flex-start;
        }
        
        /* 网格视图样式 */
        .grid-view .relations-list {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        
        .grid-view .media-section {
            height: 120px;
        }
        
        .grid-view .no-media .media-section {
            height: 120px;
        }
        
        .grid-view .info-section {
            padding: 10px;
        }
        
        .grid-view .relation-note {
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-bottom: 6px;
        }
        
        .grid-view .relation-footer {
            display: none;
        }
        
        .grid-view .action-btn {
            width: 100%;
            padding: 5px 0;
            text-align: center;
            font-size: 0.8rem;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 65px;
            background-color: var(--card-bg);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-color);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            text-decoration: none;
        }
        
        .nav-item i {
            font-size: 1.25rem;
            margin-bottom: 4px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 0.9rem;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
        
        /* 空状态 */
        .empty-state {
            padding: 60px 20px;
            text-align: center;
            color: var(--text-secondary);
        }
        
        .empty-icon {
            font-size: 4rem;
            margin-bottom: 16px;
            color: var(--border-color);
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">我的人际关系</div>
        <button class="nav-btn" id="addRelationBtn">
            <i class="fas fa-plus"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-bar">
        <div class="search-input-group">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索联系人...">
        </div>
    </div>
    
    <!-- 关系类型筛选 -->
    <div class="relation-filters">
        <div class="filter-chip active">全部关系</div>
        <div class="filter-chip">好友</div>
        <div class="filter-chip">同事</div>
        <div class="filter-chip">同学</div>
        <div class="filter-chip">家人</div>
        <div class="filter-chip">关注中</div>
        <div class="filter-chip">粉丝</div>
        <div class="filter-chip">黑名单</div>
    </div>
    
    <!-- 视图切换 -->
    <div class="view-controls">
        <div class="view-label">展示方式</div>
        <div class="view-options">
            <button class="view-btn active" data-view="card" title="卡片视图">
                <i class="fas fa-th-large"></i>
            </button>
            <button class="view-btn" data-view="list" title="列表视图">
                <i class="fas fa-list"></i>
            </button>
            <button class="view-btn" data-view="grid" title="网格视图">
                <i class="fas fa-th"></i>
            </button>
        </div>
    </div>
    
    <!-- 人际关系列表 -->
    <div class="relations-list">
        <!-- 多图联系人 -->
        <div class="relation-card multi-media">
            <div class="media-section">
                <div class="media-grid">
                    <img src="https://picsum.photos/id/64/300/300" alt="照片1" class="media-item">
                    <img src="https://picsum.photos/id/65/300/300" alt="照片2" class="media-item">
                    <img src="https://picsum.photos/id/66/300/300" alt="照片3" class="media-item">
                    <img src="https://picsum.photos/id/67/300/300" alt="照片4" class="media-item">
                    <img src="https://picsum.photos/id/68/300/300" alt="照片5" class="media-item">
                    <img src="https://picsum.photos/id/69/300/300" alt="照片6" class="media-item">
                </div>
            </div>
            
            <div class="info-section">
                <div class="relation-header">
                    <div class="person-main">
                        <img src="https://picsum.photos/id/64/100/100" alt="林小雨" class="person-avatar">
                        <div class="person-details">
                            <div class="person-name">
                                林小雨
                                <span class="relation-type">好友</span>
                            </div>
                            <div class="relation-meta">
                                <span>摄影师</span>
                                <span>·</span>
                                <span>3公里</span>
                            </div>
                        </div>
                    </div>
                    <button class="action-btn">发消息</button>
                </div>
                
                <div class="relation-body">
                    <p class="relation-note">自由摄影师，喜欢用镜头记录生活中的美好瞬间。我们是在摄影展上认识的。</p>
                    <div class="shared-interests">
                        <span class="interest-tag">摄影</span>
                        <span class="interest-tag">旅行</span>
                        <span class="interest-tag">美食</span>
                    </div>
                </div>
                
                <div class="relation-footer">
                    <div class="last-interaction">
                        <i class="fas fa-comment"></i> 3天前联系过
                    </div>
                    <div>共同好友: 5</div>
                </div>
            </div>
        </div>
        
        <!-- 单图联系人 -->
        <div class="relation-card single-media">
            <div class="media-section">
                <img src="https://picsum.photos/id/91/600/400" alt="王大山的照片" class="media-img">
            </div>
            
            <div class="info-section">
                <div class="relation-header">
                    <div class="person-main">
                        <img src="https://picsum.photos/id/91/100/100" alt="王大山" class="person-avatar">
                        <div class="person-details">
                            <div class="person-name">
                                王大山
                                <span class="relation-type">同事</span>
                            </div>
                            <div class="relation-meta">
                                <span>程序员</span>
                                <span>·</span>
                                <span>2.5公里</span>
                            </div>
                        </div>
                    </div>
                    <button class="action-btn">发消息</button>
                </div>
                
                <div class="relation-body">
                    <p class="relation-note">前公司同事，现在在互联网大厂做后端开发，技术很厉害。</p>
                    <div class="shared-interests">
                        <span class="interest-tag">编程</span>
                        <span class="interest-tag">健身</span>
                        <span class="interest-tag">电影</span>
                    </div>
                </div>
                
                <div class="relation-footer">
                    <div class="last-interaction">
                        <i class="fas fa-phone"></i> 1周前通话
                    </div>
                    <div>共同好友: 12</div>
                </div>
            </div>
        </div>
        
        <!-- 无图联系人 -->
        <div class="relation-card no-media">
            <div class="media-section">
                <div class="no-media-icon">
                    <i class="fas fa-user-circle"></i>
                </div>
                <div>未上传照片</div>
            </div>
            
            <div class="info-section">
                <div class="relation-header">
                    <div class="person-main">
                        <img src="https://picsum.photos/id/237/100/100" alt="陈思思" class="person-avatar">
                        <div class="person-details">
                            <div class="person-name">
                                陈思思
                                <span class="relation-type">同学</span>
                            </div>
                            <div class="relation-meta">
                                <span>教师</span>
                                <span>·</span>
                                <span>1.8公里</span>
                            </div>
                        </div>
                    </div>
                    <button class="action-btn">发消息</button>
                </div>
                
                <div class="relation-body">
                    <p class="relation-note">大学同班同学，现在是中学语文老师，喜欢阅读和写作。</p>
                    <div class="shared-interests">
                        <span class="interest-tag">阅读</span>
                        <span class="interest-tag">写作</span>
                        <span class="interest-tag">旅行</span>
                    </div>
                </div>
                
                <div class="relation-footer">
                    <div class="last-interaction">
                        <i class="fas fa-comment"></i> 2天前联系过
                    </div>
                    <div>共同好友: 8</div>
                </div>
            </div>
        </div>
        
        <!-- 关注中的联系人 -->
        <div class="relation-card single-media">
            <div class="media-section">
                <img src="https://picsum.photos/id/342/600/400" alt="刘阳的照片" class="media-img">
            </div>
            
            <div class="info-section">
                <div class="relation-header">
                    <div class="person-main">
                        <img src="https://picsum.photos/id/342/100/100" alt="刘阳" class="person-avatar">
                        <div class="person-details">
                            <div class="person-name">
                                刘阳
                                <span class="relation-type">关注中</span>
                            </div>
                            <div class="relation-meta">
                                <span>咖啡师</span>
                                <span>·</span>
                                <span>7.5公里</span>
                            </div>
                        </div>
                    </div>
                    <button class="action-btn secondary">已关注</button>
                </div>
                
                <div class="relation-body">
                    <p class="relation-note">精品咖啡馆创始人，对咖啡有很深的研究，经常分享咖啡知识。</p>
                    <div class="shared-interests">
                        <span class="interest-tag">咖啡</span>
                        <span class="interest-tag">美食</span>
                        <span class="interest-tag">摄影</span>
                    </div>
                </div>
                
                <div class="relation-footer">
                    <div class="last-interaction">
                        <i class="fas fa-heart"></i> 点赞了我的动态
                    </div>
                    <div>共同好友: 3</div>
                </div>
            </div>
        </div>
        
        <!-- 家人联系人 -->
        <div class="relation-card no-media">
            <div class="media-section">
                <div class="no-media-icon">
                    <i class="fas fa-user-circle"></i>
                </div>
                <div>未上传照片</div>
            </div>
            
            <div class="info-section">
                <div class="relation-header">
                    <div class="person-main">
                        <img src="https://picsum.photos/id/177/100/100" alt="张明" class="person-avatar">
                        <div class="person-details">
                            <div class="person-name">
                                张明
                                <span class="relation-type">家人</span>
                            </div>
                            <div class="relation-meta">
                                <span>金融</span>
                                <span>·</span>
                                <span>2.3公里</span>
                            </div>
                        </div>
                    </div>
                    <button class="action-btn">发消息</button>
                </div>
                
                <div class="relation-body">
                    <p class="relation-note">表哥，在银行工作，对投资理财很有研究，经常给我一些建议。</p>
                    <div class="shared-interests">
                        <span class="interest-tag">篮球</span>
                        <span class="interest-tag">音乐</span>
                        <span class="interest-tag">旅行</span>
                    </div>
                </div>
                
                <div class="relation-footer">
                    <div class="last-interaction">
                        <i class="fas fa-phone"></i> 昨天通话
                    </div>
                    <div class="relation-type">近亲</div>
                </div>
            </div>
        </div>
        
        <!-- 粉丝联系人 -->
        <div class="relation-card multi-media">
            <div class="media-section">
                <div class="media-grid">
                    <img src="https://picsum.photos/id/26/300/300" alt="照片1" class="media-item">
                    <img src="https://picsum.photos/id/27/300/300" alt="照片2" class="media-item">
                    <img src="https://picsum.photos/id/28/300/300" alt="照片3" class="media-item">
                    <img src="https://picsum.photos/id/29/300/300" alt="照片4" class="media-item">
                    <div class="media-item" style="grid-column: span 2; background-color: var(--light-bg); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 0.8rem;">
                        +3
                    </div>
                </div>
            </div>
            
            <div class="info-section">
                <div class="relation-header">
                    <div class="person-main">
                        <img src="https://picsum.photos/id/25/100/100" alt="李娜" class="person-avatar">
                        <div class="person-details">
                            <div class="person-name">
                                李娜
                                <span class="relation-type">粉丝</span>
                            </div>
                            <div class="relation-meta">
                                <span>设计师</span>
                                <span>·</span>
                                <span>5.8公里</span>
                            </div>
                        </div>
                    </div>
                    <button class="action-btn secondary">关注</button>
                </div>
                
                <div class="relation-body">
                    <p class="relation-note">平面设计师，喜欢我的摄影作品，经常互动评论。</p>
                    <div class="shared-interests">
                        <span class="interest-tag">设计</span>
                        <span class="interest-tag">摄影</span>
                        <span class="interest-tag">电影</span>
                    </div>
                </div>
                
                <div class="relation-footer">
                    <div class="last-interaction">
                        <i class="fas fa-comment"></i> 评论了我的动态
                    </div>
                    <div>共同好友: 2</div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-users"></i>
            <span>交友</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-plus-circle"></i>
            <span>发布</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-address-book"></i>
            <span>联系人</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toastMessage"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const addRelationBtn = document.getElementById('addRelationBtn');
        const viewBtns = document.querySelectorAll('.view-btn');
        const filterChips = document.querySelectorAll('.filter-chip');
        const actionBtns = document.querySelectorAll('.action-btn');
        const searchInput = document.querySelector('.search-input');
        const toastMessage = document.getElementById('toastMessage');
        
        // 初始化
        function init() {
            setupEventListeners();
        }
        
        // 设置事件监听
        function setupEventListeners() {
            // 返回按钮
            backBtn.addEventListener('click', () => {
                history.back();
                showToast('返回上一页');
            });
            
            // 添加联系人按钮
            addRelationBtn.addEventListener('click', () => {
                showToast('添加新联系人');
            });
            
            // 视图切换
            viewBtns.forEach(btn => {
                btn.addEventListener('click', () => {
                    const viewType = btn.getAttribute('data-view');
                    
                    viewBtns.forEach(b => b.classList.remove('active'));
                    btn.classList.add('active');
                    
                    // 移除所有视图类
                    document.body.classList.remove('list-view', 'grid-view');
                    
                    // 添加当前视图类
                    if (viewType === 'list') {
                        document.body.classList.add('list-view');
                    } else if (viewType === 'grid') {
                        document.body.classList.add('grid-view');
                    }
                    
                    showToast(`${btn.title}`);
                });
            });
            
            // 关系类型筛选
            filterChips.forEach(chip => {
                chip.addEventListener('click', function() {
                    filterChips.forEach(c => c.classList.remove('active'));
                    this.classList.add('active');
                    showToast(`已筛选: ${this.textContent}`);
                });
            });
            
            // 操作按钮
            actionBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    const personName = this.closest('.info-section').querySelector('.person-name').textContent.trim();
                    
                    if (this.textContent === '发消息') {
                        showToast(`正在给 ${personName} 发消息`);
                    } else if (this.textContent === '关注') {
                        this.textContent = '已关注';
                        this.classList.add('secondary');
                        showToast(`已关注 ${personName}`);
                    } else if (this.textContent === '已关注') {
                        this.textContent = '关注';
                        this.classList.remove('secondary');
                        showToast(`已取消关注 ${personName}`);
                    }
                });
            });
            
            // 搜索功能
            searchInput.addEventListener('keyup', function(e) {
                if (e.key === 'Enter') {
                    const searchText = this.value.trim();
                    if (searchText) {
                        showToast(`搜索联系人: ${searchText}`);
                    } else {
                        showToast('请输入搜索内容');
                    }
                }
            });
        }
        
        // 显示提示消息
        function showToast(message) {
            toastMessage.textContent = message;
            toastMessage.classList.add('show');
            setTimeout(() => {
                toastMessage.classList.remove('show');
            }, 2000);
        }
        
        // 初始化页面
        document.addEventListener('DOMContentLoaded', init);
    </script>
</body>
</html>
